package org.seedltd.upms.model.detection.form;

import java.math.BigDecimal;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.seedltd.core.validation.Save;
import org.seedltd.core.validation.Update;
import org.seedltd.upms.enums.EnableStatus;

import lombok.Getter;
import lombok.Setter;

/**
 *
 * 产品管理表单
 * 
 * @author laizuan
 * @version 1.0
 * @since 2021/07/28
 */
@Getter
@Setter
public class DetectionProductForm {

    /**
     * 主键
     */
    @NotNull(message = "修改数据ID不能为空，请重新进入操作页面。", groups = {Update.class})
    private Long id;

    /**
     * 产品名称
     */
    @Length(message = "产品名称长度不能超过100个字符", max = 100, groups = {Save.class})
    @NotBlank(message = "产品名称不能为空", groups = {Save.class})
    private String productName;

    /**
     * 项目检测项，多个使用英文逗号隔开
     */
    @Length(message = "项目检测项长度不能超过500个字符", max = 500, groups = {Save.class})
    @NotBlank(message = "项目检测项不能为空", groups = {Save.class})
    private String productItem;

    /**
     * 产品描述
     */
    @Length(message = "产品描述长度不能超过100个字符", max = 100, groups = {Save.class})
    private String produceDesc;

    /**
     * 原价
     */
    @Digits(integer = 10, fraction = 4, message = "请填写有效的原价浮点小数", groups = {Save.class})
    private BigDecimal origPrice;

    /**
     * 现有价格
     */
    @NotNull(message = "现有价格不能为空", groups = {Save.class})
    @Digits(integer = 10, fraction = 4, message = "请填写有效的现有价格浮点小数", groups = {Save.class})
    private BigDecimal price;

    /**
     * 推广标识，1首页显示，0不显示
     */
    @NotNull(message = "推广标识不能为空", groups = {Save.class})
    private Integer advertising;

    /**
     * 是否只能单买
     */
    @NotNull(message = "是否必要购买不能为空", groups = {Save.class})
    private Integer necessary;

    /**
     * 启禁用
     */
    @NotNull(message = "启禁用不能为空", groups = {Save.class})
    private EnableStatus enabled;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {Save.class})
    private Integer sortNo;

    /**
     * 备注
     */
    @Length(message = "备注长度不能超过200个字符", max = 200, groups = {Save.class})
    private String remark;

    /**
     * 文章内容
     */
    private String detail;
}
